-
Notifications
You must be signed in to change notification settings - Fork 311
Find PR base branch without GitHub API and enable test skipping #9080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 9 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (998.583 ms) : 0, 998583
Total [baseline] (8.575 s) : 0, 8574880
Agent [candidate] (995.008 ms) : 0, 995008
Total [candidate] (8.567 s) : 0, 8566889
section iast
Agent [baseline] (1.131 s) : 0, 1131386
Total [baseline] (9.278 s) : 0, 9278002
Agent [candidate] (1.131 s) : 0, 1131070
Total [candidate] (9.301 s) : 0, 9301017
gantt
title insecure-bank - break down per module: candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.011 ms) : 0, 690011
BytebuddyAgent [candidate] (686.824 ms) : 0, 686824
GlobalTracer [baseline] (242.42 ms) : 0, 242420
GlobalTracer [candidate] (242.06 ms) : 0, 242060
AppSec [baseline] (30.35 ms) : 0, 30350
AppSec [candidate] (30.427 ms) : 0, 30427
Debugger [baseline] (6.086 ms) : 0, 6086
Debugger [candidate] (6.073 ms) : 0, 6073
Remote Config [baseline] (675.294 µs) : 0, 675
Remote Config [candidate] (675.814 µs) : 0, 676
Telemetry [baseline] (8.324 ms) : 0, 8324
Telemetry [candidate] (8.222 ms) : 0, 8222
section iast
BytebuddyAgent [baseline] (807.328 ms) : 0, 807328
BytebuddyAgent [candidate] (806.671 ms) : 0, 806671
GlobalTracer [baseline] (231.741 ms) : 0, 231741
GlobalTracer [candidate] (231.846 ms) : 0, 231846
IAST [baseline] (28.655 ms) : 0, 28655
IAST [candidate] (28.731 ms) : 0, 28731
AppSec [baseline] (27.802 ms) : 0, 27802
AppSec [candidate] (27.03 ms) : 0, 27030
Debugger [baseline] (6.771 ms) : 0, 6771
Debugger [candidate] (7.589 ms) : 0, 7589
Remote Config [baseline] (582.961 µs) : 0, 583
Remote Config [candidate] (592.374 µs) : 0, 592
Telemetry [baseline] (7.913 ms) : 0, 7913
Telemetry [candidate] (8.027 ms) : 0, 8027
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (999.069 ms) : 0, 999069
Total [baseline] (10.701 s) : 0, 10701457
Agent [candidate] (1.001 s) : 0, 1001160
Total [candidate] (10.629 s) : 0, 10629377
section appsec
Agent [baseline] (1.179 s) : 0, 1179472
Total [baseline] (10.753 s) : 0, 10753434
Agent [candidate] (1.173 s) : 0, 1172788
Total [candidate] (10.762 s) : 0, 10761734
section iast
Agent [baseline] (1.141 s) : 0, 1140791
Total [baseline] (10.862 s) : 0, 10862074
Agent [candidate] (1.13 s) : 0, 1130217
Total [candidate] (10.812 s) : 0, 10812474
section profiling
Agent [baseline] (1.25 s) : 0, 1250451
Total [baseline] (10.99 s) : 0, 10989661
Agent [candidate] (1.245 s) : 0, 1244823
Total [candidate] (10.961 s) : 0, 10961304
gantt
title petclinic - break down per module: candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.906 ms) : 0, 690906
BytebuddyAgent [candidate] (692.391 ms) : 0, 692391
GlobalTracer [baseline] (242.251 ms) : 0, 242251
GlobalTracer [candidate] (242.706 ms) : 0, 242706
AppSec [baseline] (30.132 ms) : 0, 30132
AppSec [candidate] (30.184 ms) : 0, 30184
Debugger [baseline] (6.067 ms) : 0, 6067
Debugger [candidate] (6.128 ms) : 0, 6128
Remote Config [baseline] (676.199 µs) : 0, 676
Remote Config [candidate] (676.234 µs) : 0, 676
Telemetry [baseline] (8.188 ms) : 0, 8188
Telemetry [candidate] (8.203 ms) : 0, 8203
section appsec
BytebuddyAgent [baseline] (713.757 ms) : 0, 713757
BytebuddyAgent [candidate] (709.088 ms) : 0, 709088
GlobalTracer [baseline] (236.079 ms) : 0, 236079
GlobalTracer [candidate] (234.757 ms) : 0, 234757
AppSec [baseline] (171.033 ms) : 0, 171033
AppSec [candidate] (170.799 ms) : 0, 170799
Debugger [baseline] (5.708 ms) : 0, 5708
Debugger [candidate] (5.711 ms) : 0, 5711
Remote Config [baseline] (606.855 µs) : 0, 607
Remote Config [candidate] (593.423 µs) : 0, 593
Telemetry [baseline] (8.007 ms) : 0, 8007
Telemetry [candidate] (7.955 ms) : 0, 7955
IAST [baseline] (23.371 ms) : 0, 23371
IAST [candidate] (23.106 ms) : 0, 23106
section iast
BytebuddyAgent [baseline] (813.787 ms) : 0, 813787
BytebuddyAgent [candidate] (805.695 ms) : 0, 805695
GlobalTracer [baseline] (233.762 ms) : 0, 233762
GlobalTracer [candidate] (231.762 ms) : 0, 231762
AppSec [baseline] (30.004 ms) : 0, 30004
AppSec [candidate] (30.722 ms) : 0, 30722
Debugger [baseline] (6.717 ms) : 0, 6717
Debugger [candidate] (5.825 ms) : 0, 5825
Remote Config [baseline] (585.211 µs) : 0, 585
Remote Config [candidate] (574.313 µs) : 0, 574
Telemetry [baseline] (7.951 ms) : 0, 7951
Telemetry [candidate] (7.972 ms) : 0, 7972
IAST [baseline] (27.174 ms) : 0, 27174
IAST [candidate] (26.968 ms) : 0, 26968
section profiling
ProfilingAgent [baseline] (103.974 ms) : 0, 103974
ProfilingAgent [candidate] (104.11 ms) : 0, 104110
BytebuddyAgent [baseline] (682.066 ms) : 0, 682066
BytebuddyAgent [candidate] (678.22 ms) : 0, 678220
GlobalTracer [baseline] (362.242 ms) : 0, 362242
GlobalTracer [candidate] (360.89 ms) : 0, 360890
AppSec [baseline] (33.241 ms) : 0, 33241
AppSec [candidate] (33.829 ms) : 0, 33829
Debugger [baseline] (11.434 ms) : 0, 11434
Debugger [candidate] (10.65 ms) : 0, 10650
Remote Config [baseline] (651.841 µs) : 0, 652
Remote Config [candidate] (661.282 µs) : 0, 661
Telemetry [baseline] (7.942 ms) : 0, 7942
Telemetry [candidate] (7.988 ms) : 0, 7988
Profiling [baseline] (103.999 ms) : 0, 103999
Profiling [candidate] (104.138 ms) : 0, 104138
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
dateFormat X
axisFormat %s
section baseline
no_agent (4.485 ms) : 4431, 4540
. : milestone, 4485,
iast (9.25 ms) : 9095, 9405
. : milestone, 9250,
iast_FULL (13.811 ms) : 13538, 14083
. : milestone, 13811,
iast_GLOBAL (10.387 ms) : 10202, 10571
. : milestone, 10387,
profiling (8.852 ms) : 8716, 8988
. : milestone, 8852,
tracing (7.824 ms) : 7709, 7940
. : milestone, 7824,
section candidate
no_agent (4.439 ms) : 4390, 4489
. : milestone, 4439,
iast (9.532 ms) : 9376, 9689
. : milestone, 9532,
iast_FULL (13.908 ms) : 13631, 14185
. : milestone, 13908,
iast_GLOBAL (10.569 ms) : 10379, 10759
. : milestone, 10569,
profiling (8.817 ms) : 8670, 8965
. : milestone, 8817,
tracing (7.648 ms) : 7531, 7765
. : milestone, 7648,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
dateFormat X
axisFormat %s
section baseline
no_agent (37.531 ms) : 37226, 37836
. : milestone, 37531,
appsec (48.016 ms) : 47572, 48459
. : milestone, 48016,
code_origins (45.768 ms) : 45357, 46180
. : milestone, 45768,
iast (44.097 ms) : 43713, 44482
. : milestone, 44097,
profiling (48.055 ms) : 47622, 48489
. : milestone, 48055,
tracing (44.985 ms) : 44605, 45365
. : milestone, 44985,
section candidate
no_agent (37.488 ms) : 37176, 37800
. : milestone, 37488,
appsec (46.449 ms) : 46028, 46869
. : milestone, 46449,
code_origins (45.388 ms) : 44983, 45793
. : milestone, 45388,
iast (44.795 ms) : 44389, 45202
. : milestone, 44795,
profiling (46.146 ms) : 45711, 46581
. : milestone, 46146,
tracing (45.813 ms) : 45411, 46214
. : milestone, 45813,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
dateFormat X
axisFormat %s
section baseline
no_agent (1.482 ms) : 1471, 1494
. : milestone, 1482,
appsec (2.417 ms) : 2367, 2466
. : milestone, 2417,
iast (2.217 ms) : 2154, 2280
. : milestone, 2217,
iast_GLOBAL (2.254 ms) : 2191, 2317
. : milestone, 2254,
profiling (2.051 ms) : 2000, 2103
. : milestone, 2051,
tracing (2.031 ms) : 1983, 2080
. : milestone, 2031,
section candidate
no_agent (1.483 ms) : 1472, 1495
. : milestone, 1483,
appsec (2.426 ms) : 2376, 2476
. : milestone, 2426,
iast (2.213 ms) : 2150, 2276
. : milestone, 2213,
iast_GLOBAL (2.268 ms) : 2205, 2331
. : milestone, 2268,
profiling (2.068 ms) : 2017, 2120
. : milestone, 2068,
tracing (2.033 ms) : 1984, 2082
. : milestone, 2033,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~0ca758d26b, baseline=1.51.0-SNAPSHOT~16eee52b4d
dateFormat X
axisFormat %s
section baseline
no_agent (14.774 s) : 14774000, 14774000
. : milestone, 14774000,
appsec (14.777 s) : 14777000, 14777000
. : milestone, 14777000,
iast (18.791 s) : 18791000, 18791000
. : milestone, 18791000,
iast_GLOBAL (17.98 s) : 17980000, 17980000
. : milestone, 17980000,
profiling (15.711 s) : 15711000, 15711000
. : milestone, 15711000,
tracing (14.974 s) : 14974000, 14974000
. : milestone, 14974000,
section candidate
no_agent (15.476 s) : 15476000, 15476000
. : milestone, 15476000,
appsec (14.833 s) : 14833000, 14833000
. : milestone, 14833000,
iast (18.356 s) : 18356000, 18356000
. : milestone, 18356000,
iast_GLOBAL (18.212 s) : 18212000, 18212000
. : milestone, 18212000,
profiling (15.098 s) : 15098000, 15098000
. : milestone, 15098000,
tracing (14.596 s) : 14596000, 14596000
. : milestone, 14596000,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Introduces a pure-git heuristic to detect a PR’s base branch and re-enables test-skipping in CI without hitting GitHub API limits.
- Replaces GitHub API calls in
.gitlab/find-gh-base-ref.sh
with a merge-base distance heuristic - Enables the new base-ref detection in CI by updating
.gitlab-ci.yml
- Bails out when multiple branches share the same distance to avoid incorrect assumptions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
.gitlab/find-gh-base-ref.sh | Removed API/token logic, added get_distance_from_merge_base and candidate loop |
.gitlab-ci.yml | Re-enabled the base-ref check by removing the false && guard |
Comments suppressed due to low confidence (2)
.gitlab-ci.yml:122
- [nitpick] Ensure this line’s indentation aligns correctly under the
- |
block in the YAML to prevent parsing or execution errors after removing the commented guard.
if [[ ! $CI_COMMIT_BRANCH =~ ^(master|release/.*)$ ]]; then
.gitlab/find-gh-base-ref.sh:51
- Add unit or integration tests for the base-ref selection logic, covering both unique and ambiguous candidate scenarios to prevent regressions.
# Find the best base ref: the master/release branch whose merge base is closest to HEAD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments.
Stacked PR aren't used a lot. It should be fine to use not support this optimization for them. But in the same time, I wonder if we can find the recent branches from the committer and add them to the candidates. Would that work?
EDIT: I added Copilot as a review to check what kind of feedback it can provide on bash scripting. Not like I did not want to review your PR myself 😉
.gitlab/find-gh-base-ref.sh
Outdated
# NOTE: GitHub API is more robust for this task, but we hit rate limits. | ||
BEST_CANDIDATES=(origin/master) | ||
BEST_DISTANCE=$(get_distance_from_merge_base origin/master) | ||
mapfile -t CANDIDATE_BASES < <(git branch -a --sort=committerdate --format='%(refname:short)' --list 'origin/release/v*' | tac) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add /project/*
branches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Only added them if the current branch is not already a project branch. To avoid messing up when the project branch is being merged to master.
bd541eb
to
a4c9d0b
Compare
else | ||
echo "Failed to find base ref for PR" >&2 | ||
fi | ||
export GIT_BASE_REF=$(.gitlab/find-gh-base-ref.sh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also moved some logic here to the script. If it's master or release, it will produce no base ref. If CI_COMMIT_BRANCH
is not defined, it will also skip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Let's try it in CI
@PerfectSlayer Thanks. Thinking of what could possibly go wrong, I realized I have to test this does the right thing (skipping the logic) if we're on a git tag. |
Ok. In tag pipelines, |
What Does This Do
master
orrelease/v.*
has a merge base closest to the currentHEAD
.Motivation
Skipping tests based on git changes introduced in #9039 had to be reverted at #9078 because it did hit GitHub API rate limits.
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]